redux - rtk

2024-02-11

What is Redux? Redux is a library used for state management. It can be used with React or any other view library.

With that said, Redux Toolkit (RTK) is the official recommended approach for writing Redux logic, builds in suggested best practices and simplifies the majority of Redux tasks (along with making it more pleasant). It is also testable.

One of the cool things about RTK, it makes action creators and reducers for you which was something you had to do yourself.

Similarly to react-query there is a redux toolkit query, might as well use it if you're already in Redux universe.

redux dev tools:

"A general good rule of thumb is "if this component unmounts, do I want to keep the state?" If yes, might be app state and belongs in Redux. If no, probably not." - Brian Holt


← go back